<?php
require_once './bootstrap.php';
$req = $_REQUEST;
$id = intval($req['id'])===0 ? 1 : intval($req['id']);
$comment = array(
		'commentPATH'=>dirname(dirname(__FILE__)),
		'commentURL'=>'http://localhost/ajaxpage/v2/',
		'pageURL'=>'http://localhost/ajaxpage/v2/demo/index.php',
		'table'=>"`test`.`msg`",
		'fields'=>array(
			'primaryKey'=>'id',
			'foreignKey'=>array('key'=>'nid', 'value'=>$id), 
			'pid', 'uid', 'username', 'cont', 'status', 'ctime',
		),
		'limit'=>1,
		'cookiename'=>'commentauth',
		'req'=>$req,
		'condition'=>"`pid`='0' AND `status`='0'",
		//'orderby'
);
require_once $comment['commentPATH'].'/comment.php';
comment::initConfig($comment);
//var_dump(comment::getTotal());
comment::exec();

include './index.html';
?>